<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: Example Programs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GBDK 2020 Docs
   &#160;<span id="projectnumber">4.4.0</span>
   </div>
   <div id="projectbrief">API Documentation for GBDK 2020</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('docs_example_programs.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">Example Programs </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>GBDK includes several example programs both in C and in assembly. They are located in the examples directory, and in its subdirectories. They can be built by typing <code>make</code> in the correnponding directory.</p>
<h1><a class="anchor" id="autotoc_md196"></a>
banks (various projects)</h1>
<p>There are several different projects showing how to use ROM banking with GBDK.</p>
<h1><a class="anchor" id="autotoc_md197"></a>
comm</h1>
<p>Illustrates how to use communication routines.</p>
<h1><a class="anchor" id="autotoc_md198"></a>
crash</h1>
<p>Demonstrates how to use the optional GBDK crash handler which dumps debug info to the Game Boy screen in the event of a program crash.</p>
<h1><a class="anchor" id="autotoc_md199"></a>
colorbar</h1>
<p>The colorbar program, written by Mr. N.U. of TeamKNOx, illustrates the use of colors on a Color GameBoy.</p>
<h1><a class="anchor" id="autotoc_md200"></a>
dscan</h1>
<p>Deep Scan is a game written by Mr. N.U. of TeamKNOx that supports the Color GameBoy. Your aim is to destroy the submarines from your boat, and to avoid the projectiles that they send to you. The game should be self-explanatory. The following keys are used: </p><pre class="fragment">RIGHT/LEFT   : Move your boat
A/B          : Send a bomb from one side of your boat
START        : Start game or pause game

When game is paused:

SELECT       : Invert A and B buttons
RIGHT/LEFT   : Change speed
UP/DOWN      : Change level
</pre><h1><a class="anchor" id="autotoc_md201"></a>
filltest</h1>
<p>Demonstrates various graphics routines.</p>
<h1><a class="anchor" id="autotoc_md202"></a>
fonts</h1>
<p>Examples of how to work with the built in font and printing features.</p>
<h1><a class="anchor" id="autotoc_md203"></a>
galaxy</h1>
<p>A C translation of the space.s assembly program.</p>
<h1><a class="anchor" id="autotoc_md204"></a>
gb-dtmf</h1>
<p>The gb-dtmf, written by Osamu Ohashi, is a Dual Tone Multi-Frequency (DTMF) generator.</p>
<h1><a class="anchor" id="autotoc_md205"></a>
gbdecompress</h1>
<p>Demonstrates using gbdecompress to load a compressed tile set into VRAM.</p>
<h1><a class="anchor" id="autotoc_md206"></a>
irq</h1>
<p>Illustrates how to install interrupt handlers.</p>
<h1><a class="anchor" id="autotoc_md207"></a>
large map</h1>
<p>Shows how to scroll with maps larger than 32 x 32 tiles using <a class="el" href="gb_8h.html#adb21d1c7d533a7133bab36a845489780">set_bkg_submap()</a>. It fills rows and columns at the edges of the visible viewport (of the hardware Background Map) with the desired sub-region of the large map as it scrolls.</p>
<h1><a class="anchor" id="autotoc_md208"></a>
metasprites</h1>
<p>Demonstrates using the metasprite features to move and animate a large sprite.</p><ul>
<li>Press A button to show / hide the metasprite</li>
<li>Press B button to cycle through the metasprite animations</li>
<li>Press SELECT button to cycle the metasprite through Normal / Flip-Y / Flip-XY / Flip-X</li>
<li>Up / Down / Left / Right to move the metasprite</li>
</ul>
<h1><a class="anchor" id="autotoc_md209"></a>
lcd isr wobble</h1>
<p>An example of how to use the LCD ISR for visual special effects.</p>
<h1><a class="anchor" id="autotoc_md210"></a>
paint</h1>
<p>The paint example is a painting program. It supports different painting tools, drawing modes, and colors. At the moment, it only paints individual pixels. This program illustrates the use of the full-screen drawing library. It also illustrates the use of generic structures and big sprites. </p><pre class="fragment">Arrow keys : Move the cursor
SELECT     : Display/hide the tools palette
A          : Select tool
</pre><h1><a class="anchor" id="autotoc_md211"></a>
rand</h1>
<p>The rand program, written by Luc Van den Borre, illustrates the use of the GBDK random generator.</p>
<h1><a class="anchor" id="autotoc_md212"></a>
ram_fn</h1>
<p>The ram_fn example illustrates how to copy functions to RAM or HIRAM, and how to call them from C.</p>
<h1><a class="anchor" id="autotoc_md213"></a>
rpn</h1>
<p>A basic RPN calculator. Try entering expressions like 12 134* and then 1789+.</p>
<h1><a class="anchor" id="autotoc_md214"></a>
samptest</h1>
<p>Demonstration of playing a sound sample.</p>
<h1><a class="anchor" id="autotoc_md215"></a>
sgb (various)</h1>
<p>A collection of examples showing how to use the Super Game Boy API features.</p>
<p><a class="anchor" id="examples_sound_sample"></a></p>
<h1><a class="anchor" id="autotoc_md216"></a>
sound</h1>
<p>The sound example is meant for experimenting with the sound generator of the GameBoy (to use on a real GameBoy). The four different sound modes of the GameBoy are available. It also demonstrates the use of bit fields in C (it's a quick hack, so don't expect too much from the code). The following keys are used: </p><pre class="fragment">UP/DOWN      : Move the cursor
RIGHT/LEFT   : Increment/decrement the value
RIGHT/LEFT+A : Increment/decrement the value by 10
RIGHT/LEFT+B : Set the value to maximum/minimum
START        : Play the current mode's sound (or all modes if in control screen)
START+A      : Play a little music with the current mode's sound
SELECT       : Change the sound mode (1, 2, 3, 4 and control)
SELECT+A     : Dump the sound registers to the screen
</pre><h1><a class="anchor" id="autotoc_md217"></a>
space</h1>
<p>The space example is an assembly program that demonstrates the use of sprites, window, background, fixed-point values and more. The following keys are used: </p><pre class="fragment">Arrow keys     : Change the speed (and direction) of the sprite
Arrow keys + A : Change the speed (and direction) of the window
Arrow keys + B : Change the speed (and direction) of the background
START          : Open/close the door
SELECT         : Basic fading effect
</pre><h1><a class="anchor" id="autotoc_md218"></a>
templates</h1>
<p>Two basic template examples are provided as a starting place for writing your GBDK programs. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
</div>
</body>
</html>
